//
//  DataView.m
//  JunZeWristband
//
//  Created by Kendama on 2017/9/9.
//  Copyright © 2017年 DT. All rights reserved.
//

#import "DataView.h"

@implementation DataView

- (UILabel *)dataLabel
{
    if(!_dataLabel)
    {
        UIView *superView = self;
        _dataLabel = [[UILabel alloc]init];
        [superView addSubview:_dataLabel];
        _dataLabel.textAlignment = NSTextAlignmentCenter;
        [_dataLabel setFont:[UIFont systemFontOfSize:18]];

//        [_dataLabel setFont:[];
    }
    return _dataLabel;
}
- (UILabel *)unitLabel
{
    if(!_unitLabel)
    {
        UIView *superView = self;
        _unitLabel = [[UILabel alloc]init];
        [superView addSubview:_unitLabel];
        [_unitLabel setFont:[UIFont systemFontOfSize:14]];
        _unitLabel.textAlignment = NSTextAlignmentCenter;
        _unitLabel.textColor = [UIColor grayColor];
    }
    return _unitLabel;
}


- (void)masLayoutSubview
{
    __weak UIView *superView = self;
    [self.dataLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(superView.mas_top);
        make.centerX.mas_equalTo(superView.mas_centerX);
    }];
    
    [self.unitLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.dataLabel.mas_bottom).with.offset(px1920Height(42));
        make.centerX.mas_equalTo(superView.mas_centerX);
    }];
}

@end
